<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center release_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub release_fd0_0'>
          <view class='flex flex-wrap align-center release_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  fabuxiangqing_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='release_fd0_0_c1_c0'>立即申请</text>
          </view>
          <view class='flex flex-wrap align-center justify-end release_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction align-stretch benben-flex-layout release_flex_1">
        <view class='flex flex-direction flex-wrap align-stretch'>
          <view class='flex flex-wrap align-center release_fd1_0_c0'>
            <text class='release_fd1_0_c0_c0'>*</text>
            <text>姓名（必填）</text>
          </view>
          <view class='flex flex-wrap align-center justify-between release_fd1_0_c1'>
            <benben-input class='release_fd1_0_c2_b' type="text" :placeholder="`请输入姓名`" confirm-type="done"
              :maxlength="11" v-model="xingming" :adjust-position='true'
              placeholder-style="color:#999;font-size:28rpx" />
          </view>
        </view>
        <view class='flex flex-direction flex-wrap align-stretch'>
          <view class='flex flex-wrap align-center release_fd1_0_c0'>
            <text class='release_fd1_0_c0_c0'>*</text>
            <text>联系方式（必填）</text>
          </view>
          <view class='flex align-stretch release_fd1_0_c1' style="border-bottom: 0px solid #eee;">
            <benben-select-diy ref="showSelectPopup1710483880244"
              class-name='flex align-stretch flex release_fd1_0_c1_c0' :items.sync="typeList" v-model="typeId"
              default-type="value" default-label="name" :allow-cancel='false' type="radio" :disabled='false'>
              <template v-for='(item,key0) in typeList'>
                <view v-if="item.isSelected" class='flex align-center justify-between flex release_fd1_0_c1_c0_c0'
                  :key="key0" @tap="$refs.showSelectPopup1710483880244.tapHandle(key0)">
                  <image class='release_fd1_0_c1_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"155.png"'></image>
                  <view class='flex flex-wrap align-center'>
                    <text class='release_fd1_0_c1_c0_c0_c1_c0'>{{item.name}}</text>
                  </view>
                </view>
                <view v-else class='flex align-center justify-between flex release_fd1_0_c1_c0_c0' :key="key0"
                  @tap="$refs.showSelectPopup1710483880244.tapHandle(key0)">
                  <image class='release_fd1_0_c1_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"16.png"'></image>
                  <view class='flex flex-wrap align-center'>
                    <text class='release_fd1_0_c1_c0_c0_c1_c0'>{{item.name}}</text>
                  </view>
                </view>
              </template></benben-select-diy>
          </view>
          <benben-input class='release_fd1_0_c2' type="text" :placeholder="`请输入`" confirm-type="done" :maxlength="20"
            v-model="fangshizhi" :adjust-position='true' placeholder-style="color:#999;font-size:28rpx" />
          <!-- <text class='release_fd1_0_c3'>温馨提示：您选择其中一个输入微信号/电话号/邮箱号</text> -->
        </view>
        <view class='flex flex-direction flex-wrap align-stretch' @click.stop="pickerDiy1710485292348=true">
          <view class='flex flex-wrap align-center release_fd1_0_c0'>
            <text class='release_fd1_0_c0_c0'>*</text>
            <text>签证类型（必填）</text>
          </view>
          <view class='flex flex-wrap align-center justify-between release_fd1_0_c1'>
            <text class='release_fd1_1_c1_c0'>{{visatype_name || '请选择签证类型'}}</text>
            <image class='release_fd1_1_c1_c1' mode="aspectFit" :src='STATIC_URL+"162.png"'></image>
          </view>
        </view>
        <!-- <view class='flex flex-direction flex-wrap align-stretch release_fd1_4'>
          <view class='flex flex-wrap align-center release_fd1_0_c0'>
            <text class='release_fd1_0_c0_c0'>*</text>
            <text>特长/擅长技能（必填）</text>
          </view>
          <view class='flex flex-wrap release_fd1_4_c1'>
            <textarea class='flex release_input_fd1_4_c1' :placeholder="'请输入'" :adjust-position='true' :maxlength="40"
              :show-num='true' placeholder-style="color:#999;font-size:28rpx" v-model="techang" />
            <template>
              <view class='flex flex justify-end release_numberfd1_4_c1_c0'>
                <text>{{techang.length}}</text>
                <text>/</text>
                <text>40</text>
              </view>
            </template>
          </view>
        </view> -->
        <view class='flex flex-direction flex-wrap align-stretch'>
          <view class='flex flex-wrap align-center release_fd1_0_c0'>
            <text class='release_fd1_0_c0_c0'>*</text>
            <text>个人简历及工作技能（必填）</text>
          </view>
          <view class='flex flex-wrap release_fd1_4_c1'>
            <textarea class='flex release_input_fd1_4_c1' :placeholder="'请输入'" :adjust-position='true' :maxlength="300"
              :show-num='true' placeholder-style="color:#999;font-size:28rpx" v-model="gerenjianjie" />
            <template>
              <view class='flex flex justify-end release_numberfd1_4_c1_c0'>
                <text>{{gerenjianjie.length}}</text>
                <text>/</text>
                <text>300</text>
              </view>
            </template>
          </view>
        </view>
        <button class='release_fd1_9' @click.stop="submit">提交</button>
      </view>

      <!---flex布局flex布局结束-->
      <!--选择签证类型开始 -->
      <benben-picker ref="benbenWritePickerCodepicker2" :visible.sync="pickerDiy1710485292348" mode='selector'
        :label.sync='visatype_name' :value.sync='visatype_id' :options='visatype_list' :mask-show='true' :timeout='true'
        :picker-height='88' default-type='aid' :default-props='{"label":"name","value":"aid"}'>
        <template #picker-header>
          <view class='flex flex-wrap align-center justify-between release_picker2_0'>
            <text @tap="$refs.benbenWritePickerCodepicker2.cancel()">取消</text>
            <text>选择签证类型</text>
            <text class='release_picker2_0_c2' @tap="$refs.benbenWritePickerCodepicker2.pickerConfirm()">确认</text>
          </view>
        </template>
      </benben-picker>
      <!--选择签证类型结束 -->
    </view>
  </view>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},


    data() {
      return {
        "pickerDiy1710485292348": false,
        isWork: false,
        isDan: false,
        "typeList": [{
          "name": "手机号",
          "value": "1",
          "image": ""
        }, {
          "name": "微信号",
          "value": "2",
          "image": ""
        }, {
          "name": "邮箱号",
          "value": "3",
          "image": ""
        }],
        "typeId": "1",
        "topList": [{
          "name": "是",
          "value": "1",
          "image": ""
        }, {
          "name": "否",
          "value": "0",
          "image": ""
        }],
        xinList: [{
          "name": "面议",
          "value": "1",
          "image": ""
        }, {
          "name": "其他",
          "value": "2",
          "image": ""
        }],
        isXin: 1,
        visatype_list: [],
        worknature_list: [],
        is_top: 1,
        worknature: [],
        lianxifangshi: '',
        fangshizhi: '', //	联系方式值
        qiuzhijianshu: '', //求职简述
        gerenjianjie: "", //	个人简介
        visatype_id: '', //签证类型ID
        visatype_name: '',
        workplace_id: '', //工作地点id
        postcate_id: '', //	工作类型ID
        worknature_id: '', //工作性质id
        worknature_name: '',
        leixing: '',
        is_check: false,
        workType: [],
        workplace: [],
        workplace_name: '',
        money: '',
        zhiweiyaoqiu: '',
        zhiweimiaoshu: '', //
        xinzidaiyu: '',
        zhiweimingcheng: '',
        gongsijianjie: '',
        gongsimingcheng: '',
        postcate_name: '',
        xinziDan: [],
        xzD: '',
        techang: '',
        xingming: '',
        id: ''
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },
      isLogin() {
        return this.$store.state.token == '' ? false : true;
      }
    },
    watch: {},
    onLoad(options) {
      this.id = options.id
      this.getData()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      choose() {
        this.is_check = !this.is_check
      },
      getData() {
        this.$api.post(global.apiUrls.post65d30b91c72c7).then(res => {
          if (res.data.code == 1) { //工作性质
            this.worknature_list = res.data.data
          }
        })
        this.$api.post(global.apiUrls.post65d30df49ecb7).then(res => {
          if (res.data.code == 1) { //签证类型
            this.visatype_list = res.data.data
          }
        })
        this.$api.post(global.apiUrls.post65fa43a5184fc).then(res => {
          if (res.data.code == 1) { //xinziList
            this.xinziDan = res.data.data
            this.xzD = this.xinziDan[0].name
          }
        })
        this.$api.post(global.apiUrls.post65f7f038b0f0a).then(res => {
          if (res.data.code == 1) {
            this.money = res.data.data.top_money
          }
        })

      },
      submit() {
        if (!this.xingming) {
          this.$message.info('请输入姓名')
          return
        }
        if (this.typeId == 1) {
          if (!this.fangshizhi) {
            this.$message.info('请输入联系方式')
            return
          }
          if (!validate(this.fangshizhi, 'phone')) {
            this.$message.info(global.i18n.t('请输入正确的手机号'));
            return;
          }
        }
        if (this.typeId == 3) {
          if (!this.fangshizhi) {
            this.$message.info('请输入联系方式')
            return
          }
          if (!validate(this.fangshizhi, 'email')) {
            this.$message.info(global.i18n.t('请输入正确的邮箱号'));
            return;
          }
        }
        if (this.typeId == 2) {
          if (!this.fangshizhi) {
            this.$message.info('请输入联系方式')
            return
          }
        }


        if (!this.visatype_name) {
          this.$message.info('请选择签证类型')
          return
        }
        if (!this.gerenjianjie) {
          this.$message.info('请输入个人简历及工作技能')
          return
        }
        this.$api.dbPost(global.apiUrls.post65d47e2cbebc5, {
          fangshizhi: this.fangshizhi,
          lianxifangshi: this.typeId,
          visatype_id: this.visatype_id, //签证类型ID
          gerenjianjie: this.gerenjianjie,
          techang: this.techang,
          userpost_id: this.id,
          xingming: this.xingming
        }).then(res => {
          if (res.data.code == 1) {
            // redirectTo
            uni.navigateBack()
          }
        })
      }
    }

  };
</script>
<style lang="scss" scoped>
  .danwei {
    width: 24rpx;
    height: 24rpx;
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #F8F8F8;
    background-size: 100% auto;
  }

  .release_flex_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .release_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .release_fd0_0_c0 {
    width: 120rpx;
  }

  .release_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .release_flex_1 {
    background: var(--benbenbgColor1);
    background-size: 100% auto;
  }

  .release_fd1_9 {
    background: #4781f5;
    border-radius: 44rpx;
    width: 638rpx;
    line-height: 88rpx;
    font-size: 32rpx;
    color: #fff;
    margin: 32rpx auto 32rpx auto;
  }

  .release_fd1_8_c2 {
    color: rgba(65, 119, 221, 1);
  }

  .release_fd1_8_c1 {
    margin: 0rpx 4rpx 0rpx 12rpx;
  }

  .release_fd1_8_c0 {
    width: 32rpx;
    height: 32rpx;
  }

  .release_fd1_7_c1 {
    color: rgba(247, 62, 69, 1);
    margin: 24rpx 0rpx 32rpx 0rpx;
  }

  .release_fd1_7_c0 {
    color: rgba(191, 191, 191, 1);
  }

  .release_fd1_7 {
    margin: 0rpx auto 0rpx auto;
    width: 710rpx;
  }

  .release_fd1_6_c1_c0_c1 {
    margin: 0rpx 0rpx 0rpx 32rpx;
  }

  .release_fd1_6_c1_c0_c0 {
    width: 40rpx;
    height: 40rpx;
  }

  .release_fd1_6_c1_c0 {
    margin: 0rpx 0rpx 0rpx 24rpx;
  }

  .release_fd1_6_c0 {
    font-size: 32rpx;
    font-weight: 600;
  }

  .release_fd1_6 {
    width: 710rpx;
    margin: 20rpx auto 20rpx auto;
  }

  .release_numberfd1_4_c1_c0 {
    width: 100%;
    font-size: 24rpx;
    color: rgba(119, 119, 119, 1);
    line-height: 46rpx;
    font-weight: 400;
  }

  .release_input_fd1_4_c1 {
    // border: 1px solid var(--benbenbdColor0);
    width: 100%;
    height: 140rpx;
    font-size: 28rpx;
    font-weight: 400;
    color: #333;
    white-space: pre-wrap;
  }

  .release_fd1_4_c1 {
    border: 1px solid var(--benbenbdColor0);
    background: var(--benbenbgColor1);
    width: 710rpx;
    border-radius: 16rpx;
    padding: 10rpx 10rpx 0rpx 16rpx;
    margin: 20rpx auto 20rpx auto;
  }

  .release_fd1_4 {
    border-bottom: 1px solid #eee;
  }

  .release_fd1_1_c1_c1 {
    width: 28rpx;
    height: 28rpx;
  }

  .release_fd1_1_c1_c0 {
    line-height: 68rpx;
  }

  .release_fd1_0_c3 {
    width: 710rpx;
    margin: 20rpx auto 20rpx auto;
    color: rgba(240, 35, 37, 1);
  }

  .release_fd1_0_c2_b {
    // border-bottom: 1px solid rgba(238, 238, 238, 1);
    background: var(--benbenbgColor1);
    background-size: 100% auto;
    margin: 0rpx auto 0rpx auto;
    width: 720rpx;
    height: 84rpx;
    // border-radius: 33rpx;
    padding: 0rpx 0rpx 0rpx 20rpx;
  }

  .release_fd1_0_c2 {
    border: 1px solid rgba(238, 238, 238, 1);
    background: var(--benbenbgColor1);
    background-size: 100% auto;
    margin: 0rpx auto 0rpx auto;
    width: 720rpx;
    height: 84rpx;
    border-radius: 33rpx;
    padding: 0rpx 0rpx 0rpx 20rpx;
  }

  .release_fd1_0_c1_c0_c0_c1_c0 {
    padding: 0rpx 0rpx 0rpx 8rpx;
  }

  .release_fd1_0_c1_c0_c0_c0 {
    width: 30rpx;
    height: 30rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .release_fd1_0_c1_c0_c0 {
    height: 90rpx;
    margin-right: 20rpx;
  }

  ::v-deep .release_fd1_0_c1_c0 {
    width: 710rpx;
  }

  .release_fd1_0_c1 {
    width: 710rpx;
    margin: 0rpx auto 0rpx auto;
    border-bottom: 2rpx solid #eee;
  }

  .release_fd1_0_c0_c0 {
    margin: 0rpx 20rpx 0rpx 0rpx;
    color: rgba(240, 35, 37, 1);
    font-weight: 600;
  }

  .release_fd1_0_c0 {
    padding: 24rpx 24rpx 20rpx 24rpx;
    font-weight: 600;
    font-size: 32rpx;
  }

  .release_picker2_0_c2 {
    color: #4781f5;
  }

  .release_picker2_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
    border-radius: 25rpx 25rpx 0rpx 0rpx;
    background-size: 100% auto !important;
  }
</style>
